/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.ana.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author lucas.nunes
 */
@Entity
@Table(name = "QLTTB_STATUS_OPERACIONAL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StatusOperacional.findAll", query = "SELECT s FROM StatusOperacional s"),
    @NamedQuery(name = "StatusOperacional.findByStoId", query = "SELECT s FROM StatusOperacional s WHERE s.stoId = :stoId"),
    @NamedQuery(name = "StatusOperacional.findByStoNm", query = "SELECT s FROM StatusOperacional s WHERE s.stoNm = :stoNm"),
    @NamedQuery(name = "StatusOperacional.findByStoDs", query = "SELECT s FROM StatusOperacional s WHERE s.stoDs = :stoDs"),
    @NamedQuery(name = "StatusOperacional.findByStoCdCorrgb", query = "SELECT s FROM StatusOperacional s WHERE s.stoCdCorrgb = :stoCdCorrgb")})
public class StatusOperacional implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "STO_ID")
    private BigDecimal stoId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 104)
    @Column(name = "STO_NM")
    private String stoNm;
    @Size(max = 4000)
    @Column(name = "STO_DS")
    private String stoDs;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 14)
    @Column(name = "STO_CD_CORRGB")
    private String stoCdCorrgb;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvhStoId")
    private List<CaracterizacaoVhm> caracterizacaoVhmList;

    public StatusOperacional() {
    }

    public StatusOperacional(BigDecimal stoId) {
        this.stoId = stoId;
    }

    public StatusOperacional(BigDecimal stoId, String stoNm, String stoCdCorrgb) {
        this.stoId = stoId;
        this.stoNm = stoNm;
        this.stoCdCorrgb = stoCdCorrgb;
    }

    public BigDecimal getStoId() {
        return stoId;
    }

    public void setStoId(BigDecimal stoId) {
        this.stoId = stoId;
    }

    public String getStoNm() {
        return stoNm;
    }

    public void setStoNm(String stoNm) {
        this.stoNm = stoNm;
    }

    public String getStoDs() {
        return stoDs;
    }

    public void setStoDs(String stoDs) {
        this.stoDs = stoDs;
    }

    public String getStoCdCorrgb() {
        return stoCdCorrgb;
    }

    public void setStoCdCorrgb(String stoCdCorrgb) {
        this.stoCdCorrgb = stoCdCorrgb;
    }

    @XmlTransient
    public List<CaracterizacaoVhm> getCaracterizacaoVhmList() {
        return caracterizacaoVhmList;
    }

    public void setCaracterizacaoVhmList(List<CaracterizacaoVhm> caracterizacaoVhmList) {
        this.caracterizacaoVhmList = caracterizacaoVhmList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (stoId != null ? stoId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StatusOperacional)) {
            return false;
        }
        StatusOperacional other = (StatusOperacional) object;
        if ((this.stoId == null && other.stoId != null) || (this.stoId != null && !this.stoId.equals(other.stoId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.gov.ana.service.StatusOperacional[ stoId=" + stoId + " ]";
    }
    
}
